package com.cheer.dto;
import com.google.common.collect.Maps;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.text.NumberFormat;
import java.util.Date;
import java.util.Map;

@Data
@Accessors(chain = true)
public class ApplicantReferenceExportDTO {

    // 编号、集体名称、所属组织 、45周岁以下负责人姓名、号长手机号、职工人数、35周岁以下青年人数、35周岁以下青年人数占比、荣誉级别、获得时间、是否联合审核、参评申请日期、简要事迹
    private static Map<String, String> headerAlias = Maps.newLinkedHashMap();

    static {
        headerAlias.put("number", "编号");
        headerAlias.put("applicantName", "集体名称");
        headerAlias.put("orgName", "所属组织");
        headerAlias.put("reportOrgName", "报送组织");
        headerAlias.put("contactPerson", "45周岁以下负责人姓名");
        headerAlias.put("phoneAccount", "号长手机号");
        headerAlias.put("personNumber", "职工人数");
        headerAlias.put("youthNumber", "35周岁以下青年人数");
        headerAlias.put("youthPercent", "35周岁以下青年人数比例");
        headerAlias.put("titleStr", "荣誉级别");
        headerAlias.put("allowTime", "获得年份");
        headerAlias.put("reviewType", "是否联合审核");
        headerAlias.put("applyTime", "参评申请日期");
        headerAlias.put("achievement", "简要事迹");
    }

    @ApiModelProperty("账号ID")
    private Long number;

    @ApiModelProperty("集体名称")
    private String applicantName;

    @ApiModelProperty("报送组织")
    private String reportOrgName;

    @ApiModelProperty("所属组织")
    private String orgName;

    @ApiModelProperty("45周岁以下负责人姓名")
    private String contactPerson;

    @ApiModelProperty("号长手机号")
    private String phoneAccount;

    @ApiModelProperty("职工人数")
    private Integer personNumber;

    @ApiModelProperty("35周岁以下青年人数")
    private Integer youthNumber;

    @ApiModelProperty("35周岁以下青年人数占比")
    private String youthPercent;

    @ApiModelProperty("荣誉级别")
    private String titleStr;

    @ApiModelProperty("获得年份")
    private String allowTime;

    @ApiModelProperty("是否是联合审批 1 本机构 2 联合审批")
    private String reviewTypeStr;

    @ApiModelProperty("参评申请日期")
    private String applyTime;

    @ApiModelProperty("简要事迹")
    private String achievement;

    public void build() {
        NumberFormat nt = NumberFormat.getPercentInstance();
        this.setYouthPercent(nt.format(1.0 * youthNumber / personNumber));
    }

    public static Map<String, String> getHeaderAlias(){

        return headerAlias;
    }


}
